﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LPY.LeHealth.DTO;

namespace LPY.LeHealth.DAL
{
    using ServiceStack.OrmLite;
    public class com2dal : GenericBaseDAL<combo2>
    {
        public long Add(combo2 com)
        {
            var uid = DbConnection.Insert<combo2>(com, selectIdentity: true);
            return uid;
        }
        /// <summary>
        /// 显示信息
        /// </summary>
        /// <returns></returns>
        public List<combo2> GetAllComboType(int id)
        {
            using (var cnn = DbConnection)
            {
                var rtv = cnn.Select<combo2>().Where(n => n.uid == id).ToList();
                return rtv;
            }
        }
        /// <summary>
        /// 根据城市id显示套餐信息
        /// </summary>
        /// <param name="cityid"></param>
        /// <returns></returns>
        public List<combo2> getallbycityid(int cityid, string sex)
        {
            using (var cnn = DbConnection)
            {
                var rtv = cnn.Select<combo2>().Where(n => n.aid == cityid & n.csex == sex).ToList();
                return rtv;
            }
        }

    }
}
